/* eslint valid-jsdoc: "off" */

'use strict';

/**
 * @param {Egg.EggAppInfo} appInfo app info
 */
module.exports = appInfo => {
  /**
   * built-in config
   * @type {Egg.EggAppConfig}
   **/
  const config = exports = {};

  // use for cookie sign key, should change to your own and keep security
  config.keys = appInfo.name + '_1566747166166_7259';

  // add your middleware config here
  config.middleware = [];

  // add your user config here
  const userConfig = {
    // myAppName: 'egg',
    middleware: [ 'error' ],
    security: {
      csrf: {
        enable: false,
      },
    },
    jwt: {
      secret: 'yjs10086',
    },
    validate: { // 配置参数校验器，基于parameter
      convert: true, // 对参数可以使用convertType规则进行类型转换
      // validateRoot: false,   // 限制被验证值必须是一个对象。
    },
    encryption: {
      secret: 'yjs123456',
    },
  };

  return {
    ...config,
    ...userConfig,
  };
};
